//
//  HYNoIconClient.m
//  HYQvod
//
//  Created by shaojinkuang on 11/18/14.
//  Copyright (c) 2014 ___loveSuccess___. All rights reserved.
//

#import "HYNoIconClient.h"
#import "AFJSONRequestOperation.h"

static NSString* const HYIConBaseURLString = @"https://api.jixiemi.com/v1/";

@implementation HYNoIconClient

+ (instancetype)sharedClient {
    static HYNoIconClient* _sharedObject = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _sharedObject = [[HYNoIconClient alloc] initWithBaseURL:[NSURL URLWithString:HYIConBaseURLString]];
    });
    return _sharedObject;
}

- (id)initWithBaseURL:(NSURL *)url {
    self = [super initWithBaseURL:url];
    if (self) {
        [AFJSONRequestOperation addAcceptableContentTypes:[NSSet setWithObject:@"text/html"]];
        [self registerHTTPOperationClass:[AFJSONRequestOperation class]];
        [self setDefaultHeader:@"Accept" value:@"text/html"];
    }
    return self;
}

@end
